﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace Aribaccio.Copyright
{
    /// <summary>
    /// 注册版权期限接口
    /// </summary>
    [ComVisible(true)]
    public interface IRegisterCopyLimits
    {
        /// <summary>
        /// 注册序列号拼接符
        /// </summary>
        [DispId(1)]
        string Concatenator { get; }
        /// <summary>
        /// 检查注册版权期限期限状态
        /// </summary>
        /// <returns>剩余期限天数</returns>
        [DispId(2)]
        IRegisterCopyMsg CheckRegisterCopyLimits();
        /// <summary>
        /// 写入注册序列号
        /// </summary>
        /// <param name="argSerialNum">加密序列号字符串（包含结束/终止时间）</param>
        /// <returns></returns>
        [DispId(3)]
        IRegisterCopyMsg WriteSerialNum(string argSerialNum);
        /// <summary>
        /// 写入注册最后访问时间
        /// </summary>
        [DispId(4)]
        bool WriteDateTimeLast(string argDateTime);
        /// <summary>
        /// 写入注册最后访问时间
        /// </summary>
        /// <param name="argDateTime"></param>
        /// <returns></returns>
        [DispId(5)]
        bool WriteDateTimeLast(DateTime? argDateTime);
        /// <summary>
        /// 写入注册最后访问时间
        /// </summary>
        [DispId(6)]
        bool WriteDateTimeLast(bool argIsCheck = true);
        /// <summary>
        /// 生成注册序列号
        /// </summary>
        /// <param name="argMachineCode">机器码</param>
        /// <param name="argTimeLimit">日期期限（终止时间）</param>
        /// <returns></returns>
        string CreateSerialNum(string argMachineCode, string argTimeLimit);
        /// <summary>
        /// 生成注册序列号
        /// </summary>
        /// <param name="argMachineCode">机器码</param>
        /// <param name="argTimeLimit">日期期限（终止时间）</param>
        /// <returns></returns>
        [DispId(7)]
        string CreateSerialNum(string argMachineCode, DateTime argTimeLimit);
        /// <summary>
        /// 生成注册序列号
        /// </summary>
        /// <returns></returns>
        [DispId(8)]
        string CreateSerialNum(IRegisterCopyPara argSerialItem);
        /// <summary>
        /// 读取机器码
        /// </summary>
        /// <returns>机器码</returns>
        [DispId(9)]
        string ReadMachineCode();
    }
}
